package com.pet.common.exception;

import com.pet.model.common.enums.AppHttpCodeEnum;
import lombok.Data;

/**
 * 自定义业务异常类
 *    要求：继承Exception或RuntimeException
 */
@Data
public class LeadNewsException extends RuntimeException{
    private Integer status;//状态码

    public LeadNewsException(Integer status, String message){
        super(message);
        this.status=status;
    }

    public LeadNewsException(AppHttpCodeEnum appHttpCodeEnum){
        super((appHttpCodeEnum.getErrorMessage()));
        this.status = appHttpCodeEnum.getCode();
    }
}
